package com.tz.service;

import com.tz.dao.CategoryDao;
import com.tz.entity.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 类别service接口实现类
 *
 * @Created:
 * @Date:
 */
@Service
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private CategoryDao categoryDao;

    /**
     * @param category
     * @return Category
     */
    @Override
    public Category save(Category category) {
        categoryDao.save(category);
        return category;
    }

    /***
     *
     * @return List<Category>
     */
    @Override
    public List<Category> getAll() {
        List<Category> list = categoryDao.getAll();
        return list;
    }

    /***
     *
     * @param level
     * @return
     */
    @Override
    public List<Category> getByLevel(int level) {
        List<Category> list = categoryDao.getByLevel(level);
        return null;
    }
}
